/*
 * ServerLauncher.java
 *
 * Written by: 
 * Czahrien <czahrien@gmail.com>
 * 
 * Version 6.0
 *
 * Licensing:
 * I am not going to be a stickler about licensing and all that jazz. Just be 
 * sure to give credit to me where credit is due and we can all get along like
 * grown-ups. Okay?
 *
 * Description:
 * This is a wrapper meant for Notch's Survival Multiplayer server, version 
 * 0.1.0. It is not guaranteed to work well with later versions.
 *
 * While this code is far from my best work, it does demonstrate an approach to
 * take to wrap a server of this type. Most of this is hastily thrown together
 * and as a result I use a lot of static data members.
 */

import java.io.*;
import java.util.*;
import java.util.regex.*;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.text.ParseException;


public class Item {
	public String description;
	public String kitName;
	public int price;
	
	public Item( String line ) {
		String[] parts = line.split( ";" );
		if( parts.length >= 3 ) {
			try {
//				System.err.println( "name: "+ parts[0] + " kit: " + parts[1] + " price: " +parts[2]); 
				description = parts[0];
				kitName = parts[1].toLowerCase();
				price = Integer.parseInt( parts[2] );
			} catch( NumberFormatException e ) {
				System.err.println( "ERROR: Invalid line Item parsing" ); 
			}
		} else {
			System.err.println( "ERROR: Invalid line in Item parsing" ); 
		}
	}
	
	public String toString() {
		String toStr = "" + description + ";" + kitName + ";" + price;
		System.err.println(toStr);
		return toStr;
	}
}